<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/manage/header.jsp"%>
<div>
	<c:choose>
		<c:when test="${not empty users}">
			<form action="${pageContext.request.contextPath}/client/CilentServlet?op=regist&&opType=update" method="post">
			     <input type="hidden" name="id" value="${users.id}" />
				<table border="1" width="438">
					<tr>
						<td>用户名：</td>
						<td><input type="text" name="username"
							value="${users.username }" /></td>
					</tr>
					<tr>
						<td>密码：</td>
						<td><input type="password" name="password"  value="${users.username }"/></td>
					</tr>
					<tr>
						<td>电话：</td>
						<td><input type="text" name="phonenum"   value="${users.phonenum }"/></td>
					</tr>
					<tr>
						<td>家庭地址：</td>
						<td><input type="text" name="address"   value="${users.address }"/></td>
					</tr>
					<tr>
						<td>邮箱：</td>
						<td><input type="text" name="email"   value="${users.email }"/></td>
					</tr>
					<tr>
						<td>类别：</td>
						<td><select name="type" value="${users.type}">
								<option value="0" <c:if test="${'0' eq users.type}">selected</c:if>>老师</option>
								<option value="1" <c:if test="${'1' eq users.type}">selected</c:if>>学生</option>
						    </select>
						</td>
						
					</tr>
					<tr>
						<td colspan="2"><input type="submit" value="更新" /></td>
					</tr>
				</table>
			</form>
		</c:when>
		<c:otherwise>
			<form
				action="${pageContext.request.contextPath}/client/CilentServlet?op=regist&&opType=save" method="post">
				<table border="1" width="438">
					<tr>
						<td>用户名：</td>
						<td><input type="text" name="username"
							value="${users.username }" /></td>
					</tr>
					<tr>
						<td>密码：</td>
						<td><input type="password" name="password" /></td>
					</tr>
					<tr>
						<td>电话：</td>
						<td><input type="text" name="phonenum" /></td>
					</tr>
					<tr>
						<td>邮寄地址：</td>
						<td><input type="text" name="address" /></td>
					</tr>
					<tr>
						<td>邮箱：</td>
						<td><input type="text" name="email" /></td>
					</tr>
					<tr>
						<td>类别：</td>
						<td><select name="type">
								<option value="0">老师</option>
								<option value="1">学生</option>
						</select></td>
					</tr>
					<tr>
						<td colspan="2"><input type="submit" value="注册" /></td>
					</tr>
				</table>
			</form>
		</c:otherwise>
	</c:choose>

</div>
</body>
</html>
